//--------------------------------------------
//
// copyright@2008,all right reserved by ax.
//
//
//     PROJECT   :   futrue
//
//     FILE      :   BaseCmdPool.h
//
//     PURPOSE   :   futrue project main file
//   
//     DATE      :   2008/10/01
//
//     AUTHOR    :   ax
//
//--------------------------------------------
#ifndef __FUTRUE_BASE_COMMAND_POOL_H__
#define __FUTRUE_BASE_COMMAND_POOL_H__
#include "BaseCommand.h"

 
class PoolObj;
class BaseCmdPool
{
	BaseCmdPool();
 
public: 

	virtual ~BaseCmdPool()
	{
		UnInit();
	}
 
	static BaseCmdPool& GetInstance()
	{
		static BaseCmdPool the;
		return the;
	}

	int  Init();
	void UnInit();

	BaseCommand*  Alloc(int nKey);

    void  Free(BaseCommand* p);

private: 	
 
	PoolObj*   m_pPool;
};
#endif